From: Alexandre Emsenhuber Date: Wed, 10 Oct 2012 19:35:42 +0000 (+0200) Subject: Use Html class instead of Xml where possible in Special:Contributions X-Git-Tag: 1.31.0-rc.0~21912^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=530b9166d20916eb1428252d30490249dbe3b0ac;p=lhc%2Fweb%2Fwiklou.git Use Html class instead of Xml where possible in Special:Contributions Also simplified the code by using Html::rawElement() instead of openElement() and closeElement() and added some lines breaks to the output for better readability. Change-Id: Ie7ce5c65ba34b30799580acda0a9d82eb38d257f --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index ca8c9c8eb4..689e096e26 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -399,7 +399,7 @@ class SpecialContributions extends SpecialPage { $this->opts['topOnly'] = false; } - $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'class' => 'mw-contributions-form' ) ); + $form = Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'class' => 'mw-contributions-form' ) ); # Add hidden params for tracking except for parameters in $skipParameters $skipParameters = array( 'namespace', 'nsInvert', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly', 'associated' ); @@ -414,13 +414,13 @@ class SpecialContributions extends SpecialPage { if ( $tagFilter ) { $filterSelection = - Xml::tags( 'td', array( 'class' => 'mw-label' ), array_shift( $tagFilter ) ) . - Xml::tags( 'td', array( 'class' => 'mw-input' ), implode( ' ', $tagFilter ) ); + Html::rawElement( 'td', array( 'class' => 'mw-label' ), array_shift( $tagFilter ) ) . + Html::rawElement( 'td', array( 'class' => 'mw-input' ), implode( ' ', $tagFilter ) ); } else { - $filterSelection = Xml::tags( 'td', array( 'colspan' => 2 ), '' ); + $filterSelection = Html::rawElement( 'td', array( 'colspan' => 2 ), '' ); } - $targetSelection = Xml::tags( 'td', array( 'colspan' => 2 ), + $targetSelection = Html::rawElement( 'td', array( 'colspan' => 2 ), Xml::radioLabel( $this->msg( 'sp-contributions-newbies' )->text(), 'contribs', @@ -455,7 +455,7 @@ class SpecialContributions extends SpecialPage { '' ) ) . - Xml::tags( 'td', null, + Html::rawElement( 'td', null, Html::namespaceSelector( array( 'selected' => $this->opts['namespace'], 'all' => '', @@ -499,7 +499,7 @@ class SpecialContributions extends SpecialPage { $deletedOnlyCheck = ''; } - $extraOptions = Xml::tags( 'td', array( 'colspan' => 2 ), + $extraOptions = Html::rawElement( 'td', array( 'colspan' => 2 ), $deletedOnlyCheck . Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), Xml::checkLabel( @@ -510,7 +510,7 @@ class SpecialContributions extends SpecialPage { array( 'class' => 'mw-input' ) ) ) - ) ; + ); $dateSelectionAndSubmit = Xml::tags( 'td', array( 'colspan' => 2 ), Xml::dateMenu( @@ -525,23 +525,13 @@ class SpecialContributions extends SpecialPage { $form .= Xml::fieldset( $this->msg( 'sp-contributions-search' )->text() ) . - Xml::openElement( 'table', array( 'class' => 'mw-contributions-table' ) ) . - Xml::openElement( 'tr' ) . - $targetSelection . - Xml::closeElement( 'tr' ) . - Xml::openElement( 'tr' ) . - $namespaceSelection . - Xml::closeElement( 'tr' ) . - Xml::openElement( 'tr' ) . - $filterSelection . - Xml::closeElement( 'tr' ) . - Xml::openElement( 'tr' ) . - $extraOptions . - Xml::closeElement( 'tr' ) . - Xml::openElement( 'tr' ) . - $dateSelectionAndSubmit . - Xml::closeElement( 'tr' ) . - Xml::closeElement( 'table' ); + Html::rawElement( 'table', array( 'class' => 'mw-contributions-table' ), "\n" . + Html::rawElement( 'tr', array(), $targetSelection ) . "\n" . + Html::rawElement( 'tr', array(), $namespaceSelection ) . "\n" . + Html::rawElement( 'tr', array(), $filterSelection ) . "\n" . + Html::rawElement( 'tr', array(), $extraOptions ) . "\n" . + Html::rawElement( 'tr', array(), $dateSelectionAndSubmit ) . "\n" + ); $explain = $this->msg( 'sp-contributions-explain' ); if ( $explain->exists() ) {